<?php
class Curso extends AppModel {
	var $name = 'Curso';
	var $validate = array(
		'id' => array(
			'blank' => array(
				'rule' => array('blank'),
				'on' => 'create' 
			)
		),
		'integrado' => array(
			'boolean' => array(
				'rule' => array('boolean')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'nombre' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '255')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'duracion' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '100')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'observacion' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '100')
			)
		),
		'comentariopago' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '255')
			)
		),
		'precio' => array(
			'decimal' => array(
				'rule' => array('decimal',2)
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'disponible' => array(
			'boolean' => array(
				'rule' => array('boolean')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'pagina' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '100')
			)
		),
		'pagohora' => array(
			'decimal' => array(
				'rule' => array('decimal',2)
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'categoria_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'created' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'nombre_corto' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '255')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		)
	);

	var $belongsTo = array(
		'Categoria' => array(
			'className' => 'Categoria',
			'foreignKey' => 'categoria_id'
		)
	);

	var $hasMany = array(
		'CartaPago' => array(
			'className' => 'CartaPago',
			'foreignKey' => 'curso_id'
		),
		'DisponibilidadesAperturaHorario' => array(
			'className' => 'DisponibilidadesAperturaHorario',
			'foreignKey' => 'curso_id'
		),
		'Duda' => array(
			'className' => 'Duda',
			'foreignKey' => 'curso_id'
		),
		'Encuesta' => array(
			'className' => 'Encuesta',
			'foreignKey' => 'curso_id'
		),
		'FacturaCurso' => array(
			'className' => 'FacturaCurso',
			'foreignKey' => 'curso_id'
		),
		'Grupo' => array(
			'className' => 'Grupo',
			'foreignKey' => 'curso_id'
		),
		'InstructorCurso' => array(
			'className' => 'InstructorCurso',
			'foreignKey' => 'curso_id'
		),
		'ReciboGastoCurso' => array(
			'className' => 'ReciboGastoCurso',
			'foreignKey' => 'curso_id'
		),
		'ReciboVentaCurso' => array(
			'className' => 'ReciboVentaCurso',
			'foreignKey' => 'curso_id'
		),
		'RecordatorioCartaPago' => array(
			'className' => 'RecordatorioCartaPago',
			'foreignKey' => 'curso_id'
		),
		'SolicitudEspera' => array(
			'className' => 'SolicitudEspera',
			'foreignKey' => 'curso_id'
		),
		'Temario' => array(
			'className' => 'Temario',
			'foreignKey' => 'curso_id'
		),
		'Tentativo' => array(
			'className' => 'Tentativo',
			'foreignKey' => 'curso_id'
		)
	);
}
?>